import request from '@/utils/request'

export function apiGetList(params, loading) {
  return request({
    url: `/obj/genSchemaController/list`,
    method: 'get',
    params,
    loading,
    autoUntie: false,
  })
}

export function apiAdd(data) {
  return request({
    url: '/obj/genSchemaController/add',
    method: 'post',
    data: data,
  })
}
export function apiEdit(data) {
  return request({
    url: '/obj/genSchemaController/edit',
    method: 'put',
    data: data,
  })
}

export function apiDel(ids) {
  return request({
    url: '/obj/genSchemaController/' + ids,
    method: 'delete',
  })
}


export function apiGetBusTypeList(params, loading) {
  return request({
    url: `/obj/busController/referGrid`,
    method: 'get',
    params,
    loading,
    resField: 'data',
  })
}

export function apiCodeProduce(code) {
  return request({
    url: '/obj/genSchemaController/produce',
    method: 'post',
    params: {
      code: code,
    },
  })
}

export function apiCodePreviewData(code, loading) {
  return request({
    url: '/obj/genSchemaController/preview',
    method: 'get',
    params: {
      code: code,
    },
    loading,
  })
}
